import layoutHeaderAside from '@/layout/header-aside'

const meta = { auth: true }

export default {
  path: '/goods',
  name: 'goods',
  meta,
  redirect: { name: 'product-list' },
  component: layoutHeaderAside,
  children: (pre => [
    {
      path: 'product/list',
      name: `${pre}list`,
      component: () => import('@/pages/goods/product/list'),
      meta: { ...meta, title: '商品列表' }
    },
    {
      path: 'product/add',
      name: `${pre}add`,
      component: () => import('@/pages/goods/product/add'),
      meta: { ...meta, title: '添加商品' }
    },
    {
      path: 'cate/list',
      name: `${pre}cate-list`,
      component: () => import('@/pages/goods/cate/list'),
      meta: { ...meta, title: '类别管理' }
    },
    {
      path: 'brand/list',
      name: `${pre}brand-list`,
      component: () => import('@/pages/goods/brand/list'),
      meta: { ...meta, title: '品牌管理' }
    },
    {
      path: 'attr/index',
      name: `${pre}attr-index`,
      component: () => import('@/pages/goods/attr/index'),
      meta: { ...meta, title: '商品类型' }
    },
    {
      path: 'attr/list',
      name: `${pre}attr-list`,
      component: () => import('@/pages/goods/attr/list'),
      meta: { ...meta, title: '商品属性列表' }
    },
    {
      path: 'attr/add',
      name: `${pre}attr-add`,
      component: () => import('@/pages/goods/attr/add'),
      meta: { ...meta, title: '添加商品属性' }
    }
  ])('goods-')
}
